package com.example.demo.service.impl;

import com.example.demo.domain.Role;
import com.example.demo.domain.Vo.roleListVo;
import com.example.demo.mapper.RoleMapper;
import com.example.demo.mapper.RoleMenuMapper;
import com.example.demo.service.IRoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 服务层
 */
@Service
public class RoleServiceImpl implements IRoleService {

    @Autowired
    private RoleMapper roleMapper;

//    @Autowired
//    private RoleMenuMapper roleMenuMapper;


    /**
     * 查询角色
     * @param role
     * @return
     */
    @Override
    public List<roleListVo> selectRole(Role role) {
        return roleMapper.selectRole(role);
    }

    /**
     * 新增角色
     * @param role
     */
    @Override
    public void insertRole(Role role) {
        roleMapper.insertRole(role);
    }

    /**
     * 修改角色
     * @param role
     */
    @Override
    public void updateRoleById(Role role) {
        roleMapper.updateRoleById(role);
    }

    /**
     * 删除角色
     * @param id
     */
    @Override
    public void delRoleById(String id) {
        roleMapper.delRoleById(id);

    }
}
